var t = require("util.js"), e = require("../siteinfo.js"), r = require("./q.js"), a = {
    WebUrl: e.siteroot + "?i=" + e.uniacid + "&from=wxapp&m=group_buy&a=wxapp&c=entry&do=",
    Format: "json"
}, n = function(t, e) {
    for (var r in e) t[r] = e[r];
    return t;
}, i = function(e, a, n) {
    var i = r.defer(), s = "POST" == e ? "application/x-www-form-urlencoded" : "text/html";
    return wx.request({
        url: a,
        method: e,
        data: n,
        header: {
            "Content-Type": s,
            pagePath: (0, t.currentPagePath)()
        },
        success: function(t) {
            i.resolve(t.data);
        },
        fail: function(t) {
            wx.showToast({
                title: "请求失败" + t.errMsg,
                icon: "none",
                duration: 3e3
            }), setTimeout(function() {
                wx.navigateTo({
                    url: "/pages/template/netOverTime"
                });
            }, 3e3);
        },
        complete: function(t) {
            i.notify(1);
        }
    }), i.promise;
}, s = function(t, e) {
    return i("GET", t, e);
}, o = function(t, e) {
    return i("POST", t, e);
};

module.exports = {
    getUrl: function(t) {
        return a.WebUrl + t;
    },
    getWebUrl: function() {
        return a.WebUrl;
    },
    getParams: function(t, e) {
        t || (t = {}), t.l = a.LanguageMark, t.Format = a.Format;
        var r = wx.getStorageSync("Token") || "";
        return r && (t.Token = r), e && (t.Sign = this.getSign(t)), t;
    },
    inserUserdata: function(t) {
        var e = this.getUrl("insertUserInfo");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getOpenid: function(t) {
        var e = this.getUrl("getOpenid");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getMember: function(t) {
        var e = this.getUrl("getMember");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getHead: function(t) {
        var e = this.getUrl("getHead");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    getNearestHead: function(t) {
        var e = this.getUrl("getNearestHead");
        return t = this.getParams(t), o(e, t);
    },
    selectHead: function(t) {
        var e = this.getUrl("selectHead");
        return t = this.getParams(t), o(e, t);
    },
    getTeamOpenid: function(t) {
        var e = this.getUrl("getTeamOpenid");
        return t = this.getParams(t), o(e, t);
    },
    applyHead: function(t) {
        var e = this.getUrl("wantHead");
        return t = this.getParams(t), o(e, t);
    },
    getClassify: function(t) {
        var e = this.getUrl("getgoodscate");
        return console.log(e), t = n({}, t), t = this.getParams(t), s(e, t);
    },
    getGoods: function(t) {
        var e = this.getUrl("getGoods");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    getActionGoods: function(t) {
        var e = this.getUrl("getActionGoods");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    getAction: function(t) {
        var e = this.getUrl("getAction");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    seeIndexSeckill: function(t) {
        var e = this.getUrl("seeIndexSeckill");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    seckillGetGoods: function(t) {
        var e = this.getUrl("Seckill_get_goods");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    seckillorder: function(t) {
        var e = this.getUrl("Seckill_order");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    seckillOrderPay: function(t) {
        var e = this.getUrl("Seckill_order_pay");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    Seckill_GetSpecInfo: function(t) {
        var e = this.getUrl("Seckill_GetSpecInfo");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    Seckill_GetSpecDeatail: function(t) {
        var e = this.getUrl("Seckill_GetSpecDeatail");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    sharegoods: function(t) {
        var e = this.getUrl("sharegoods");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    getBanner: function(t) {
        var e = this.getUrl("getBanner");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    addCart: function(t) {
        var e = this.getUrl("addCart");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getCart: function(t) {
        var e = this.getUrl("getCart");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    cartGoodsDel: function(t) {
        var e = this.getUrl("cartGoodsDel");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getCartNum: function(t) {
        var e = this.getUrl("getCartNum");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getAddress: function(t) {
        var e = this.getUrl("getAddress");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    seeUserTicket: function(t) {
        var e = this.getUrl("seeUserTicket");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    Order: function(t) {
        var e = this.getUrl("Order");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    buyIntime: function(t) {
        var e = this.getUrl("buyIntime");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    buyIntimeOrder: function(t) {
        var e = this.getUrl("buyIntimeOrder");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getHeadLinkVillage: function(t) {
        var e = this.getUrl("getHeadLinkVillage");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    payment: function(t) {
        var e = this.getUrl("order_status_info");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    savecart: function(t) {
        var e = this.getUrl("editCartNum");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    shopping_cart: function(t) {
        var e = this.getUrl("getCart");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    two_class: function(t) {
        var e = this.getUrl("getGoodsCate");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getsuggest: function(t) {
        var e = this.getUrl("getGoodsCate");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getOrder: function(t) {
        var e = this.getUrl("getOrder");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    delOrder: function(t) {
        var e = this.getUrl("delOrder");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    userdelOrder: function(t) {
        var e = this.getUrl("userdelOrder");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getAllTicket: function(t) {
        var e = this.getUrl("getAllTicket");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    userGetTicket: function(t) {
        var e = this.getUrl("userGetTicket");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getQRCode: function(t) {
        var e = this.getUrl("qrcode");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getorderDetails: function(t) {
        var e = this.getUrl("getorderDetails");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getorder_pay: function(t) {
        var e = this.getUrl("getorder_pay");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getTeamOrder: function(t) {
        var e = this.getUrl("getTeamOrder");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getAllBuyPeople: function(t) {
        var e = this.getUrl("getAllBuyPeople");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getQRCodes: function(t) {
        var e = this.getUrl("getQRCode");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    seeTeam: function(t) {
        var e = this.getUrl("seeTeam");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    seeTeamRecommend: function(t) {
        var e = this.getUrl("seeTeamRecommend");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    headCommissionList: function(t) {
        var e = this.getUrl("headCommissionList");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    seeTeamData: function(t) {
        var e = this.getUrl("seeTeamData");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    TzseeTeamData: function(t) {
        var e = this.getUrl("TzseeTeamData");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    TeamWallet: function(t) {
        var e = this.getUrl("TeamWallet");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    Watir: function(t) {
        var e = this.getUrl("Watir");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    get_wx_phone: function(t) {
        var e = this.getUrl("get_wx_phone");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    TeamCommissionCenter: function(t) {
        var e = this.getUrl("TeamCommissionCenter");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    TeamLastSenvenMoney: function(t) {
        var e = this.getUrl("TeamLastSenvenMoney");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    Watirorders: function(t) {
        var e = this.getUrl("Watirorders");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getSeverPhone: function(t) {
        var e = this.getUrl("getSeverPhone");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    applyGetCash: function(t) {
        var e = this.getUrl("applyGetCash");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    TzapplyGetCash: function(t) {
        var e = this.getUrl("TzapplyGetCash");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    headGetCashList: function(t) {
        var e = this.getUrl("headGetCashList");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    headGetMoneyToBalance: function(t) {
        var e = this.getUrl("headGetMoneyToBalance");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    seeTitleSet: function(t) {
        var e = this.getUrl("seeTitleSet");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getBannerPage: function(t) {
        var e = this.getUrl("getBannerPage");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    userSureGoods: function(t) {
        var e = this.getUrl("userSureGoods");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getUserCommission: function(t) {
        var e = this.getUrl("getUserCommission");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getUserGetCash: function(t) {
        var e = this.getUrl("getUserGetCash");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    backGoodsInfo: function(t) {
        var e = this.getUrl("backGoodsInfo");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    applyBackMoney: function(t) {
        var e = this.getUrl("applyBackMoney");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getBackMoneyOrder: function(t) {
        var e = this.getUrl("getBackMoneyOrder");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getBackMoneyInfo: function(t) {
        var e = this.getUrl("getBackMoneyInfo");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    selectShareHead: function(t) {
        var e = this.getUrl("selectShareHead");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetSnMd5: function(t) {
        var e = this.getUrl("GetSnMd5");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetCityList: function(t) {
        var e = this.getUrl("GetCityList");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetVillageInfo: function(t) {
        var e = this.getUrl("GetVillageInfo");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    CheckGoods: function(t) {
        var e = this.getUrl("CheckGoods");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetTeamRank: function(t) {
        var e = this.getUrl("GetTeamRank");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    headMemberRank: function(t) {
        var e = this.getUrl("headMemberRank");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetTeamRankSet: function(t) {
        var e = this.getUrl("GetTeamRankSet");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    ApplaySupplier: function(t) {
        var e = this.getUrl("ApplaySupplier");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getIndexData: function(t) {
        var e = this.getUrl("IndexData");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_index: function(t) {
        var e = this.getUrl("Fraction_index");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_shop_list: function(t) {
        var e = this.getUrl("Fraction_shop_list");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_explain: function(t) {
        var e = this.getUrl("Fraction_explain");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_info: function(t) {
        var e = this.getUrl("Fraction_info");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_shopping_info: function(t) {
        var e = this.getUrl("Fraction_shopping_info");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_shopping: function(t) {
        var e = this.getUrl("Fraction_shopping");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_shopping_order: function(t) {
        var e = this.getUrl("Fraction_shopping_order");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_Inter: function(t) {
        var e = this.getUrl("Fraction_Inter");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_order: function(t) {
        var e = this.getUrl("Fraction_order");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_order_info: function(t) {
        var e = this.getUrl("Fraction_order_info");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_pick_up_goods: function(t) {
        var e = this.getUrl("Fraction_pick_up_goods");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_order_details: function(t) {
        var e = this.getUrl("Fraction_order_details");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getFraction_order_pay: function(t) {
        var e = this.getUrl("Fraction_order_pay");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetSpecInfo: function(t) {
        var e = this.getUrl("GetSpecInfo");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetSpecDeatail: function(t) {
        var e = this.getUrl("GetSpecDeatail");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    SpecAddCart: function(t) {
        var e = this.getUrl("SpecAddCart");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    IsHaveIntegral: function(t) {
        var e = this.getUrl("IsHaveIntegral");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetApplyHeadSet: function(t) {
        var e = this.getUrl("GetApplyHeadSet");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetApplySupplierSet: function(t) {
        var e = this.getUrl("GetApplySupplierSet");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getGoodsInfoSet: function(t) {
        var e = this.getUrl("getGoodsInfoSet");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetCopyrightSet: function(t) {
        var e = this.getUrl("GetCopyrightSet");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    SetHeadInfo: function(t) {
        var e = this.getUrl("SetHeadInfo");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetTeamGoods: function(t) {
        var e = this.getUrl("GetTeamGoods");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    TeamOpenGoods: function(t) {
        var e = this.getUrl("TeamOpenGoods");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    TeamCLoseGoods: function(t) {
        var e = this.getUrl("TeamCLoseGoods");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetOrderNotice: function(t) {
        var e = this.getUrl("GetOrderNotice");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetAllHeadHistory: function(t) {
        var e = this.getUrl("GetAllHeadHistory");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetUserDeafaultAddress: function(t) {
        var e = this.getUrl("GetUserDeafaultAddress");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetOpenShipSet: function(t) {
        var e = this.getUrl("GetOpenShipSet");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetSendPrice: function(t) {
        var e = this.getUrl("GetSendPrice");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GoodsInfoRecommend: function(t) {
        var e = this.getUrl("GoodsInfoRecommend");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    Seckillindex: function(t) {
        var e = this.getUrl("Seckill_index");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    markrting: function(t) {
        var e = this.getUrl("markrting");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    cardshow: function(t) {
        var e = this.getUrl("card_show");
        return t = n({}, t), t = this.getParams(t), s(e, t);
    },
    GetHeadSendOrderList: function(t) {
        var e = this.getUrl("GetHeadSendOrderList");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    HeadSureSendOrderList: function(t) {
        var e = this.getUrl("HeadSureSendOrderList");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetHeadSendGoodsList: function(t) {
        var e = this.getUrl("GetHeadSendGoodsList");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    plsugins: function(t) {
        var e = this.getUrl("plsugins");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    H5authorization: function(t) {
        var e = this.getUrl("H5authorization");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    AfterHeadgetGoodsList: function(t) {
        var e = this.getUrl("AfterHeadgetGoodsList");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    GetContentArticle: function(t) {
        var e = this.getUrl("GetContentArticle");
        return t = n({}, t), t = this.getParams(t), o(e, t);
    },
    getfooter: function(t) {
        var e = wx.getStorageSync("nav");
        console.log(e);
        var r = e;
        if ("" != r) for (var a = getCurrentPages(), n = "/" + a[a.length - 1].route, i = 0; i < r.params.data.length; i++) n == r.params.data[i].url && (r.params.data[i].nav = 2, 
        r.params.nav = 2);
        return r;
    }
};